package vista;
import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;

import controlador.Controlador;
import modelo.dao.DAO;


public class FrameSocUsu extends JFrame {

	private JPanel contentPane;
	private JPanel padre;

	/**
	 * Launch the application.
	 */
	public static void main(final boolean tipo, final DAO d, final Controlador c, final JPanel padre) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					FrameSocUsu frame = new FrameSocUsu(tipo, d, c, padre);
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public FrameSocUsu(boolean tipo, DAO d, Controlador c, JPanel dad) {
		setResizable(false);
		setAlwaysOnTop(true);
		this.padre = dad;
		setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
		setBounds(100, 100, 450, 300);
		if (tipo){
			contentPane = new PanelNuevoSocio(d, c);
			contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
			contentPane.setLayout(new BorderLayout(0, 0));
			setContentPane(contentPane);
		}else{
			contentPane = new PanelNuevoUsuario(d, c);
			contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
			contentPane.setLayout(new BorderLayout(0, 0));
			setContentPane(contentPane);
		}
		
	}
	
	public JPanel getPadre(){
		return this.padre;
	}


}
